package com.guchenbo.flink;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author guchenbo
 * @date 2024/6/9
 */
public class DataStreamDemo {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment executionEnvironment
                        = StreamExecutionEnvironment.getExecutionEnvironment();
        DataStream<String> dataStream = executionEnvironment.fromElements(
                        "This is a first sentence",
                        "This is a second sentence with a one word");
        SingleOutputStreamOperator<String> upperCase = dataStream.map(String::toUpperCase);
        upperCase.print();
        executionEnvironment.execute();
    }
}
